package com.yuan.pdf;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;

@RestController
public class pdfcontrol {
@GetMapping("a")
    public void exportpdf(HttpServletResponse response) throws Exception {
    HashMap<String, Object> dataMap = new HashMap<>();
    String fileName="pdftest";
    dataMap.put("name","wangwu");
    dataMap.put("age","23");
    HashMap<String, Object> checkBoxMap = new HashMap<>();
    checkBoxMap.put("b","a");
    dataMap.put("checkBoxMap",checkBoxMap);
    pdfuntils.exportPdfByPdf(fileName+".pdf", dataMap,fileName ,response);

}
}
